import { CSSProperties, FC } from "react"
type PropsType = {
    title: string;
    isCenter?: boolean;
}
const QuestionParagraph:FC<PropsType> = (props: PropsType) => {
    const {title='', isCenter} = props;
    const style: CSSProperties = {};
    if (isCenter) {
        style.textAlign = 'center';
    }
    const textList = title.split('\n');
    return <p style={style}>
        {
        textList.map((text, index) => (
            <span key={index}>
                {index > 0 && <br/>}
                {text}
            </span>
        ))}
        </p>
    
   
}
export default QuestionParagraph;